<page-header [autoTitle]="false"></page-header>
<nz-card>
  <section class="search-section">
    <input nz-input placeholder="收件人姓名" [(ngModel)]="keyword" class="search-item"/>

    <nz-select [(ngModel)]="salesmanId" [nzPlaceHolder]="'所属账号'" class="search-item" [nzAllowClear]="true" [nzShowSearch]="true">
    <nz-option
      *ngFor="let option of allSalesmans"
      [nzLabel]="option.name"
      [nzValue]="option.id">
    </nz-option>
  </nz-select>
    <nz-select [(ngModel)]="status" [nzPlaceHolder]="'发货状态'" class="search-item" [nzAllowClear]="true">
      <nz-option
        *ngFor="let option of statusOptions"
        [nzLabel]="option.value"
        [nzValue]="option.key">
      </nz-option>
    </nz-select>
    <!--<nz-select [(ngModel)]="serviceStatus" [nzPlaceHolder]="'状态'" class="search-item" [nzAllowClear]="true" *ngIf="method == 2">
      <nz-option
        *ngFor="let option of cakeOrderServiceStatusOption"
        [nzLabel]="option.value"
        [nzValue]="option.key">
      </nz-option>
    </nz-select>-->
    <button nz-button [nzType]="'primary'" nzGhost (click)="search()" class="search-item">
      <i class="anticon anticon-search"></i><span>搜索</span>
    </button>
  </section>
  <nz-table #nzTable [nzData]="page.content"
            [nzPageSize]="page.size"
            [nzTotal]="page.totalElements"
            [nzFrontPagination]="false"
            [(nzPageIndex)]="page.number"
            (nzPageIndexChange)="changePageNo($event)"
            [nzLoading]="isLoading">
    <thead>
    <tr>
      <th nz-th><span>序号</span></th>
      <th nz-th><span>订单号</span></th>
      <th nz-th><span>收件人姓名</span></th>
      <th nz-th><span>收件人电话</span></th>
      <th nz-th><span>所属账号</span></th>
      <th nz-th><span>账号角色</span></th>
      <th nz-th><span>产品名称</span></th>
      <th nz-th><span>发货数量</span></th>
      <th nz-th><span>预定发货时间</span></th>
      <th nz-th><span>发货状态</span></th>
      <th nz-th><span>操作</span></th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of nzTable.data;let i=index">
      <td>
        {{i+1}}
      </td>
      <td>{{data.orderNo}}</td>
      <td>{{data.postalName}}</td>
      <td>{{data.postalPhone}}</td>
      <td>{{data.salesmanId|dicsNamePipe:allSalesmans:"id":"name"}}</td>
      <td>{{data.salesmanRole|dicsNamePipe:salesmanRoleOptions}}</td>
      <td>{{data.productId|dicsNamePipe:allProducts:"id":"title"}}</td>
      <td>{{data.goodsQuantity}}({{data.productId|dicsNamePipe:allProducts:"id":"unit"}})</td>
      <td>{{data.planPostalTime}}</td>
      <td>{{data.status|dicsNamePipe:statusOptions}}</td>
      <td>
        <a href="javascript:void (0);" (click)="seeEntity(data)">查看详情</a>
        <span *ngIf="data.status == 1">
          <nz-divider nzType="vertical"></nz-divider>
          <a href="javascript:void (0);" (click)="logistics(data)">确认发货</a>
        </span>
      </td>
    </tr>
    </tbody>
  </nz-table>
</nz-card>
